<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>同步和异步</title>
</head>
<body>
    

    <script>
        
        {
           // 异步

           console.log(100); 
           setTimeout(() => {
               console.log(200);
           }, 1000);
           console.log(300);
        }

        {
            // 同步
            console.log(100);
            alert(200)
            console.log(300);
        }
    
    
    </script>

</body>
</html>